home *** CD-ROM | disk | FTP | other *** search
- {PLOTEXAM.PAS / EXAMPLE FOR THE PLOTING PIXELS}
- {WRITING BY THE KING IN 10/13/95 }
-
- Uses Crt;
- {------------------------------------------------}
- {Set Mode To Mode 13H , 320x200x256 Colors.. }
- {------------------------------------------------}
-
- Procedure SetMode;Assembler;
- Asm
- Mov Ah,00h {Function 00,13 Interrupt 10h / SET MODE}
- Mov Al,13h
- Int 10h {SETING TO MODE 13H}
- End;
- {------------------------------------------------}
- {Plot a single pixel on the screen . }
- {------------------------------------------------}
- Procedure PutPixel(X,Y:Integer;Col:Byte);Assembler;
- Asm
- Mov Ax,0a000h {Ax = SEGMENT OF THE SCREEN}
- Mov Es,Ax {Es = SEGMENT OF THE SCREEN}
- Mov Ax,320 {Ax = MAX VERTICAL LINE}
- Mul Y {Ax = AX * Y = HORIZONTAL LINE}
- Add Ax,X {Ax = VERTICAL LINE + HORIZONTAL LINE = OFFSET}
- Mov Di,Ax {DI = OFFSET}
- Mov Al,Col {AL = COLOR}
- StoSb {[0A000h:OFFSET] = COLOR}
- End;
- {------------------------------------------------}
- {Set Mode To Mode 3H , 80x25x16 Colors.. }
- {------------------------------------------------}
- Procedure SetTextMode;Assembler;
- Asm
- Mov Ah,00h {Function 00,3 Interrupt 10h / SET MODE}
- Mov Al,3h
- Int 10h {SET MODE TO MODE 3 / TEXT MODE}
- End;
-
- Var
- T:Word;
- Begin
- SetMode;
- Randomize;
- For T:=1 To 65535 Do
- Begin
- PutPixel(Random(320),Random(200),Random(256));
- End;
- Repeat
- Until(Keypressed);
- SetTextMode;
- Writeln('Thanks For Watching! .. Greatings From The King.');
- Writeln;
-
- End.